home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / MISC / MAG10.ZIP / OBJGEN.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-08-19  |  2.1 KB  |  80 lines

  1. Program ObjGen;
  2.  
  3. Uses Crt;
  4.  
  5. Type ObjType=Record
  6.                    Name:String[80];
  7.                    Pos:Byte;
  8.                    Desc:Array[1..5] Of String[80];
  9.              End;
  10.  
  11. Var F:Text;
  12.     Filename:String;
  13.     NumberObjs:Byte;
  14.  
  15.     A:Byte;
  16.     B:Byte;
  17.     R:ObjType;
  18.     Flag:Boolean;
  19.  
  20. Begin
  21.      Clrscr;
  22.      Textcolor(Yellow);
  23.      Write('«««««««««««««««««««««««««««««« Object Generator »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»');
  24.      Writeln;
  25.      Textcolor(Magenta);
  26.      Writeln('                                By Spellcaster');
  27.      Writeln;
  28.      Textcolor(Cyan);
  29.      Writeln('Type in the name of the file on which the data of the objects');
  30.      Writeln('will be write...');
  31.      Textcolor(Green);
  32.      Write('Name of the object-file > ');
  33.      Readln(Filename);
  34.      If Filename='' Then Exit;
  35.      Textcolor(Cyan);
  36.      Writeln('Type in the number of objects that the game has...');
  37.      Textcolor(LightRed);
  38.      Write('Number of objects > ');
  39.      Readln(NumberObjs);
  40.      If NumberObjs=0 Then Exit;
  41.      Assign(F,Filename);
  42.      ReWrite(F);
  43.      For A:=1 To NumberObjs Do
  44.      Begin
  45.           Writeln;
  46.           Textcolor(Cyan);
  47.           Writeln('Object ',A);
  48.           Writeln;
  49.           Textcolor(LightGreen);
  50.           Write('Name of object > '); Readln(R.Name);
  51.           Writeln;
  52.           Write('Initial position of object > '); Readln(R.Pos);
  53.           For B:=1 To 5 Do R.Desc[B]:='';
  54.           Flag:=True;
  55.           B:=1;
  56.           While Flag Do
  57.           Begin
  58.                Writeln('Description Line ',B);
  59.                Readln(R.Desc[B]);
  60.                If (B=5) Or (R.Desc[B]='*') Then Flag:=False;
  61.                Inc(B);
  62.           End;
  63.           Writeln(F,R.Name);
  64.           WritelN(F,R.Pos);
  65.           B:=1;
  66.           Flag:=True;
  67.           While Flag Do
  68.           Begin
  69.                Writeln(F,R.Desc[B]);
  70.                If (R.Desc[B]='*') Or (B=10) Then Flag:=False;
  71.                Inc(B);
  72.           End;
  73.      End;
  74.      Writeln;
  75.      Close(F);
  76.      Textcolor(Lightred);
  77.      Writeln('The room data is saved...');
  78.      Textcolor(LightGray);
  79.      Repeat Until Keypressed;
  80. End.